package exsun.jt808.data.media.operate.http;

import com.alibaba.fastjson.JSONObject;
import exsun.jt808.data.media.data.MediaRequest;
import exsun.jt808.data.util.HttpUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author houzw
 *
 */
@SuppressWarnings("deprecation")
public class MediaPlayOrder {

	private final static Logger logger = LoggerFactory.getLogger(MediaPlayOrder.class);
	private final static int connTimeout = 60000;
	private final static int readTimeout = 60000;

	private  String getPlayVideoUrl(String basePath) {
		return basePath + "VideoPlay";
	}

	public String playVideo(MediaRequest item, String basePath){
		String param = JSONObject.toJSONString(item);
		String url = getPlayVideoUrl(basePath);
		String result = HttpUtil.sendPost(url, param, connTimeout, readTimeout, "UTF-8");
		return result;
	}



}
